#pragma once

#ifndef __static_assert_H__
#define __static_assert_H__

#include "FLOW_core/namespace.h"

namespace CORE
{
	template< bool > struct CompileTimeChecker
	{
		CompileTimeChecker( ... ) {}
	};

	template< > 
	struct CompileTimeChecker< false > { };

} //namespace CORE

/*!
 * \brief Assertion in compile time
 *
 * Assertion in compile time, msg must be a valid C++ identifier,
 * no spaces, punctuation or reserved keywords
 */

#ifndef NDEBUG
#define STATIC_ASSERT( expr, msg )											\
do {																		\
	struct ERROR_##msg {};													\
	typedef CORE::CompileTimeChecker< (expr) != 0 > StaticChecker;			\
	StaticChecker temp = StaticChecker( ERROR_##msg( ) );					\
	sizeof( temp );															\
} while( false )
#else
#define STATIC_ASSERT( expr, msg ) do{}while( false )
#endif

#endif
